package com.atguigu.srb.core.controller.api;


import com.atguigu.srb.base.response.R;
import com.atguigu.srb.core.pojo.entity.LendItemReturn;
import com.atguigu.srb.core.service.LendItemReturnService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 标的出借回款记录表 前端控制器
 * </p>
 *
 * @author Atguigu
 * @since 2023-05-26
 */
@RestController
@RequestMapping("/api/core/lendItemReturn")
public class ApiLendItemReturnController {
    @Resource
    LendItemReturnService lendItemReturnService;

    @ApiOperation("会员查询标的的自己的投资回款记录")
    @GetMapping("auth/list/{lendId}")
    public R list(@PathVariable("lendId")String lendId,
                  @RequestHeader("token")String token){
        List<LendItemReturn> lendItemReturnList = lendItemReturnService
                .listByLendIdAndUserId(lendId,token);
        return R.ok().data("items",lendItemReturnList);
    }
}

